load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test")

licenses(["notice"])

package(default_visibility = ["//stub/src/test:__subpackages__"])

kt_jvm_library(
    name = "AbstractCallsTest",
    testonly = True,
    srcs = [":AbstractCallsTest.kt"],
    deps = [
        "//stub/src/test/proto/helloworld:hello_world_kt_grpc",
        "@grpc-java//testing",
    ],
)

kt_jvm_test(
    name = "ClientCallsTest",
    srcs = [":ClientCallsTest.kt"],
    test_class = "io.grpc.kotlin.ClientCallsTest",
    deps = [
        ":AbstractCallsTest",
        "//stub/src/test/proto/helloworld:hello_world_kt_grpc",
        "@grpc_kotlin_maven//:com_google_truth_extensions_truth_proto_extension",
    ],
)

kt_jvm_test(
    name = "FlowControlTest",
    srcs = [":FlowControlTest.kt"],
    test_class = "io.grpc.kotlin.FlowControlTest",
    deps = [
        ":AbstractCallsTest",
        "//stub/src/test/proto/helloworld:hello_world_kt_grpc",
        "@grpc_kotlin_maven//:com_google_truth_truth",
    ],
)

kt_jvm_test(
    name = "GeneratedCodeTest",
    srcs = [":GeneratedCodeTest.kt"],
    test_class = "io.grpc.kotlin.GeneratedCodeTest",
    deps = [
        ":AbstractCallsTest",
        "//stub/src/test/proto/helloworld:hello_world_kt_grpc",
        "@grpc_kotlin_maven//:com_google_truth_extensions_truth_proto_extension",
    ],
)

kt_jvm_test(
    name = "GrpcContextElementTest",
    srcs = [":GrpcContextElementTest.kt"],
    test_class = "io.grpc.kotlin.GrpcContextElementTest",
    deps = [
        "//stub/src/main/java/io/grpc/kotlin:context",
        "@grpc-java//core",
        "@grpc_kotlin_maven//:com_google_truth_truth",
        "@grpc_kotlin_maven//:org_jetbrains_kotlinx_kotlinx_coroutines_core",
    ],
)

kt_jvm_test(
    name = "ServerCallsTest",
    srcs = [":ServerCallsTest.kt"],
    test_class = "io.grpc.kotlin.ServerCallsTest",
    deps = [
        ":AbstractCallsTest",
        "//stub/src/test/proto/helloworld:hello_world_kt_grpc",
        "@grpc_kotlin_maven//:com_google_truth_extensions_truth_proto_extension",
    ],
)
